1. Field of the Invention
The present invention relates to disk drives for computer systems. More particularly, the present invention relates to a disk drive that adjusts a read-ahead to optimize cache memory allocation.
2. Description of the Prior Art
A disk drive typically comprises a cache memory for caching data written to the disk as well as data read from the disk. The overall performance of the disk drive is affected by how efficiently the cache memory can be allocated for a read command. In the past, the cache memory has been divided into cache segments each comprising a number of blocks (e.g., eight blocks), wherein the cache system would allocate a number of cache segments to process the read command. This technique is inefficient, however, if the number of blocks in a cache segment does not integer divide into the number of blocks associated with processing the read command leaving part of a cache segment allocated but unused.